package com.co.vote.web.base;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import com.co.common.utils.PageReq;

public interface BaseController<T>{
	
	String list( Model model,HttpSession session,HttpServletRequest request,HttpServletResponse response, PageReq pageReq,T query);
	
	String addInit( Model model,HttpSession session,HttpServletRequest request,HttpServletResponse response);

	String edit( Model model,HttpSession session,HttpServletRequest request,HttpServletResponse response,T t,@PathVariable Integer id, @PathVariable Integer pageNumber);
	
	String saveAdd(Model model,HttpSession session,HttpServletRequest request,HttpServletResponse response,T t,PageReq pageReq,RedirectAttributes redirectAttributes);
	
	String saveEdit(Model model,HttpSession session,HttpServletRequest request,HttpServletResponse response,T t,PageReq pageReq,RedirectAttributes redirectAttributes);

	Map<String, Object> delete(HttpSession session,HttpServletRequest request,HttpServletResponse response,T t,@PathVariable Integer id);
	
}
